<?php
class YouNet_Form_Element_Ga extends Zend_Form_Element_Text
{
	private $_specs = 'google_analytics_id';
	private $_options = array(
			'label'		=> "Google Analytics ID <span class='tooltip_label' title='This Google Analytics ID will be added to the FAQ on Fan Page so that you could measure traffic and performance right on your Google Analytics Tool.'>[?]</span>",
			'required'	=> false,
			'filters'	=> array('StringTrim'),
            'description' => "Example: UA-321321-1"
		);
	
	public function __construct($specs = NULL, $options = NULL)
	{
		if (isset($specs))
			$this->_specs = $specs;
		if (isset($options))
			$this->_options = array_merge($this->_options, $options);
			
		parent::__construct($this->_specs, $this->_options);
		$this->addValidator('regex', true, array('/^[A-Za-z0-9\-]+$/'))
                ->addErrorMessage('Acceptable characters are A-Z, 0-9 and ""-"" in Google Analytics ID.');
		$this->getDecorator('Label')->setOption('escape',false);
	}
}